<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加载指示器 - 组件演示</title>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div class="container">
        <header class="header">
            <h1>🚀 openHarmony_Cordova_NutpiDesign</h1>
            <p class="subtitle">组件演示 - 加载指示器组件</p>
        </header>

        <nav class="demo-nav">
            <a href="../index.html" class="nav-back">← 返回首页</a>
        </nav>

        <main class="main-content">
            <section class="demo-section">
                <h2>⏳ 加载指示器演示</h2>
                
                <div class="demo-container">
                    <div class="demo-item">
                        <h3>圆形加载</h3>
                        <div class="spinner"></div>
                    </div>

                    <div class="demo-item">
                        <h3>条形加载</h3>
                        <div class="spinner-bar"></div>
                    </div>

                    <div class="demo-item">
                        <h3>点状加载</h3>
                        <div class="spinner-dots"></div>
                    </div>

                    <div class="demo-item">
                        <h3>脉冲加载</h3>
                        <div class="spinner-pulse"></div>
                    </div>

                    <div class="demo-item">
                        <h3>小号加载</h3>
                        <div class="spinner-small"></div>
                    </div>

                    <div class="demo-item">
                        <h3>大号加载</h3>
                        <div class="spinner-large"></div>
                    </div>
                </div>
            </section>

            <section class="demo-section">
                <h2>使用代码</h2>
                <pre><code>// 加载指示器组件
&lt;div class="spinner"&gt;&lt;/div&gt;

// 自定义颜色
&lt;div class="spinner" style="color: #ff6b6b;"&gt;&lt;/div&gt;</code></pre>
            </section>
        </main>

        <footer class="footer">
            <p>&copy; 2025 OpenHarmony 三方库适配中心 | MIT License</p>
        </footer>
    </div>

    <style>
        .demo-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .demo-item {
            background: var(--bg-light);
            padding: 16px;
            border-radius: 8px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 150px;
        }

        .demo-item h3 {
            margin-top: 0;
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-primary);
            width: 100%;
        }

        /* 加载指示器样式 */
        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .spinner-bar {
            width: 40px;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), transparent);
            border-radius: 2px;
            animation: slide 1.5s ease-in-out infinite;
        }

        .spinner-dots {
            display: flex;
            gap: 4px;
        }

        .spinner-dots::before,
        .spinner-dots::after {
            content: '';
            width: 8px;
            height: 8px;
            background: var(--primary-color);
            border-radius: 50%;
            animation: bounce 1.4s infinite;
        }

        .spinner-dots::after {
            animation-delay: 0.2s;
        }

        .spinner-pulse {
            width: 40px;
            height: 40px;
            background: var(--primary-color);
            border-radius: 50%;
            animation: pulse 2s ease-in-out infinite;
        }

        .spinner-small {
            width: 20px;
            height: 20px;
            border: 2px solid #f3f3f3;
            border-top: 2px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .spinner-large {
            width: 60px;
            height: 60px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes slide {
            0% { transform: translateX(-100%); }
            50% { transform: translateX(100%); }
            100% { transform: translateX(-100%); }
        }

        @keyframes bounce {
            0%, 80%, 100% { opacity: 0.3; }
            40% { opacity: 1; }
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.3; }
            50% { opacity: 1; }
        }
    </style>
</body>
</html>
